﻿using System;

namespace NodeJS.fs
{
    /// <summary>
    /// Objects returned from fs.watch() are of this type.
    /// </summary>
    public abstract class FSWatcher
    {
        /// <summary>
        /// Stop watching for changes on the given fs.FSWatcher.
        /// </summary>
        public abstract void Close();

        /// <summary>
        /// Emitted when something changes in a watched directory or file. See more details in fs.watch.
        /// <para>event: String The type of fs change</para>
        /// <para>filename: String The filename that changed (if relevant/available)</para>
        /// </summary>
        [EvalAtCompile(Value = "change")]
        public const NodeEvent<string, string> CHANGE = null;

        /// <summary>
        /// Emitted when an error occurs.
        /// </summary>
        [EvalAtCompile(Value = "error")]
        public const NodeEvent<Exception> ERROR = null;
    }
}
